<?php

require_once APP_DIR . '/models/Comment.php';

class Comments
{
	/**
	 * An gateway to retrieve instances of the Comment active record object.
	 *
	 * @var Zend_Db_ActiveRecord_Gateway
	 */
	protected $comments;
	
	
	public function __construct()
	{
		$this->comments = new Zend_Db_ActiveRecord_Gateway('Comment');
	}
	
	
	public function loadComments() {
		$select = $this->comments->select();
		return $this->comments->fetchAll($select);
	}
	
	public function saveComment($comment)
	{
		$comment = new Comments($comment);
		$comment->save();
		return $comment;
	}
	
	public function deleteComment($commentId)
	{
		$this->comments->delete($commentId);
	}
	
}
